import { api } from "@/lib/api";
import BlogsList from "@/app/myComponents/server/BlogsList";
import { BlogType } from "@/types/blog";
async function Blog() {
  const res = await fetch(await api("/api/blog"), {
    cache: "no-store",
  });
  const users = await res.json();
  return (
    <div className="space-y-4">
      {users.map((blog: BlogType) => (
        <BlogsList key={blog.id} blog={blog} />
      ))}
    </div>
  );
}

export default Blog;
